<!-- saved from url=(0014)about:internet -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>FlowersViewBase.as</title>
<link rel="stylesheet" type="text/css" href="../../../../../SourceStyles.css"/>
</head>

<body><pre><span class="ActionScriptpackage">package</span> <span class="ActionScriptDefault_Text">com</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">flowersinc</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">shop</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">views</span>
<span class="ActionScriptBracket/Brace">{</span>
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">com</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">flowersinc</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">shop</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">model</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">Flower</span>;
    
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">flash</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">events</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">Event</span>;
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">flash</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">events</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">MouseEvent</span>;
    
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">collections</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">ArrayCollection</span>;
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">containers</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">Canvas</span>;
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">controls</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">Button</span>;
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">controls</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">DataGrid</span>;
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">controls</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">Image</span>;
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">core</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">DragSource</span>;
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">events</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">CloseEvent</span>;
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">managers</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">DragManager</span>;
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">managers</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">PopUpManager</span>;

    <span class="ActionScriptReserved">public</span> <span class="ActionScriptclass">class</span> <span class="ActionScriptDefault_Text">FlowersViewBase</span> <span class="ActionScriptReserved">extends</span> <span class="ActionScriptDefault_Text">Canvas</span>
    <span class="ActionScriptBracket/Brace">{</span>
        
        <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Bindable</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">get</span> <span class="ActionScriptDefault_Text">flowers</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span> : <span class="ActionScriptDefault_Text">ArrayCollection</span> 
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">_flowers</span>;
        <span class="ActionScriptBracket/Brace">}</span>
        
        <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">set</span> <span class="ActionScriptDefault_Text">flowers</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">value</span> : <span class="ActionScriptDefault_Text">ArrayCollection</span><span class="ActionScriptBracket/Brace">)</span> : <span class="ActionScriptReserved">void</span> 
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">_flowers</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">value</span>;
            
            <span class="ActionScriptReserved">for each</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">flower</span> : <span class="ActionScriptDefault_Text">Flower</span> <span class="ActionScriptReserved">in</span> <span class="ActionScriptDefault_Text">value</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">flower</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">"orderPlaced"</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">onOrderPlaced</span><span class="ActionScriptBracket/Brace">)</span>; <span class="ActionScriptComment">// to make every flower in dataGrid listener 
</span>                <span class="ActionScriptDefault_Text">flower</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">"infoShowed"</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">onInfoShowed</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptBracket/Brace">}</span> 
        
        <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">get</span> <span class="ActionScriptDefault_Text">selectedFlower</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span> : <span class="ActionScriptDefault_Text">Flower</span> 
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">_selectedFlower</span>;
        <span class="ActionScriptBracket/Brace">}</span>
        
        <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">set</span> <span class="ActionScriptDefault_Text">selectedFlower</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">value</span> : <span class="ActionScriptDefault_Text">Flower</span><span class="ActionScriptBracket/Brace">)</span> : <span class="ActionScriptReserved">void</span> 
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">_selectedFlower</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">value</span>;
            <span class="ActionScriptDefault_Text">flowersDataGrid</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">selectedItem</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">selectedFlower</span>;
        <span class="ActionScriptBracket/Brace">}</span>
        
        <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Bindable</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptReserved">public</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">flowersDataGrid</span> : <span class="ActionScriptDefault_Text">DataGrid</span>;
        <span class="ActionScriptReserved">public</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">shoppingChart</span> : <span class="ActionScriptDefault_Text">ShoppingCartBase</span>;
        
        <span class="ActionScriptReserved">protected</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onGridMouseDown</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span> : <span class="ActionScriptDefault_Text">MouseEvent</span><span class="ActionScriptBracket/Brace">)</span> : <span class="ActionScriptReserved">void</span> 
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">flower</span> : <span class="ActionScriptDefault_Text">Flower</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">Flower</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">flowersDataGrid</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">selectedItem</span><span class="ActionScriptBracket/Brace">)</span>;
            
            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">image</span> : <span class="ActionScriptDefault_Text">Image</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Image</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">image</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">source</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">flower</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">thumbImage</span>;
            <span class="ActionScriptDefault_Text">image</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">width</span> <span class="ActionScriptOperator">=</span> 70;
            <span class="ActionScriptDefault_Text">image</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">height</span> <span class="ActionScriptOperator">=</span> 70;
                
            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">dragSource</span> : <span class="ActionScriptDefault_Text">DragSource</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">DragSource</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">dragSource</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">addData</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">flower</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptString">"flower"</span><span class="ActionScriptBracket/Brace">)</span>;
            
            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">offsetx</span> : <span class="ActionScriptDefault_Text">int</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptOperator">-</span><span class="ActionScriptDefault_Text">flowersDataGrid</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">contentMouseX</span> <span class="ActionScriptOperator">-</span> 15;
            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">offsety</span> : <span class="ActionScriptDefault_Text">int</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptOperator">-</span><span class="ActionScriptDefault_Text">flowersDataGrid</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">contentMouseY</span> <span class="ActionScriptOperator">-</span> 15;
      
              <span class="ActionScriptDefault_Text">DragManager</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">doDrag</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">flowersDataGrid</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">dragSource</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">image</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">offsetx</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">offsety</span><span class="ActionScriptOperator">,</span> 0.8<span class="ActionScriptBracket/Brace">)</span>;        
        <span class="ActionScriptBracket/Brace">}</span>
        
        <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onOrderPlaced</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span> : <span class="ActionScriptDefault_Text">Event</span><span class="ActionScriptBracket/Brace">)</span> : <span class="ActionScriptReserved">void</span> <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">shoppingChart</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">addToCart</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">Flower</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">target</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptBracket/Brace">)</span>;    
        <span class="ActionScriptBracket/Brace">}</span>
            
        <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onInfoShowed</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span> : <span class="ActionScriptDefault_Text">Event</span><span class="ActionScriptBracket/Brace">)</span> : <span class="ActionScriptReserved">void</span> 
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">getPopUpByFlower</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">Flower</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">flowersDataGrid</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">selectedItem</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptReserved">null</span><span class="ActionScriptBracket/Brace">)</span> 
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">popUp</span> : <span class="ActionScriptDefault_Text">PopUpWindow</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">PopUpManager</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">createPopUp</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptReserved">this</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">PopUpWindow</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptReserved">false</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptReserved">as</span> <span class="ActionScriptDefault_Text">PopUpWindow</span>;
                <span class="ActionScriptDefault_Text">PopUpManager</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">centerPopUp</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">popUp</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptDefault_Text">popUp</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">Event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">CLOSE</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">onPopUpClose</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptDefault_Text">popUp</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">"flowerOrdered"</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">onFlowerOrdered</span><span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptDefault_Text">popUp</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">flower</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">Flower</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">flowersDataGrid</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">selectedItem</span><span class="ActionScriptBracket/Brace">)</span>;
                
                <span class="ActionScriptDefault_Text">_currentPopUps</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">addItem</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">popUp</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptBracket/Brace">}</span>    
        
        <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onPopUpClose</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span> : <span class="ActionScriptDefault_Text">CloseEvent</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span> 
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">PopUpManager</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">removePopUp</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">PopUpWindow</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">currentTarget</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">_currentPopUps</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">removeItemAt</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_currentPopUps</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">getItemIndex</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">currentTarget</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptBracket/Brace">)</span>;
        <span class="ActionScriptBracket/Brace">}</span>
        
        <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onFlowerOrdered</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span> : <span class="ActionScriptDefault_Text">Event</span><span class="ActionScriptBracket/Brace">)</span> : <span class="ActionScriptReserved">void</span> 
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">shoppingChart</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">addToCart</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">PopUpWindow</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">currentTarget</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">flower</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">PopUpManager</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">removePopUp</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">PopUpWindow</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">currentTarget</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">_currentPopUps</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">removeItemAt</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_currentPopUps</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">getItemIndex</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">currentTarget</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptBracket/Brace">)</span>;
        <span class="ActionScriptBracket/Brace">}</span>
        
        <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">getPopUpByFlower</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">flower</span> : <span class="ActionScriptDefault_Text">Flower</span><span class="ActionScriptBracket/Brace">)</span> : <span class="ActionScriptDefault_Text">PopUpWindow</span> 
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">for each</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">item</span> : <span class="ActionScriptDefault_Text">PopUpWindow</span> <span class="ActionScriptReserved">in</span> <span class="ActionScriptDefault_Text">_currentPopUps</span><span class="ActionScriptBracket/Brace">)</span> 
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">item</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">flower</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptDefault_Text">flower</span><span class="ActionScriptBracket/Brace">)</span> 
                <span class="ActionScriptBracket/Brace">{</span>
                    <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">item</span>;
                <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptBracket/Brace">}</span>
            
            <span class="ActionScriptReserved">return</span> <span class="ActionScriptReserved">null</span>;
        <span class="ActionScriptBracket/Brace">}</span>        
        
        <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_flowers</span> : <span class="ActionScriptDefault_Text">ArrayCollection</span>;
        <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_selectedFlower</span> : <span class="ActionScriptDefault_Text">Flower</span>;
        <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_currentPopUps</span> : <span class="ActionScriptDefault_Text">ArrayCollection</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">ArrayCollection</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>;
    <span class="ActionScriptBracket/Brace">}</span>
<span class="ActionScriptBracket/Brace">}</span></pre></body>
</html>
